<template>
  <section class="page bg-white">
    <headerbar>{{title}}</headerbar>

    <section class="inner-content no-shadow">
      <section class="detail">
        <h1 class="title">{{preData.title}}</h1>
        <p class="date">来源：{{preData.source || '未知'}} <span class="float-right">时间：{{preData.createTime}}</span></p>
        <p class="color-red pdh-2 pdv-1 shortTitle">{{preData.shortTitle}}</p>
        <p class="line"></p>
        <div class="cont-text" v-if="detail.newsContentExt" v-html="detail.newsContentExt.contents">

        </div>
      </section>
    </section>

  </section>
</template>

<script>
  export default {
    name: 'specialDetail',
    data () {
      return {
        preData: {},
        detail: {},
        title: ''
      }
    },
    created () {
      this.preData = this.$store.state.specialDetail
      let flag = this.$route.query.flag
      if (flag === 1) {
        this.title = '活动'
      } else if (flag === 2) {
        this.title = '专题'
      } else {
        this.title = '政策文件'
      }
      this.loadData()
    },
    methods: {
      loadData () {
        let id = this.$route.query.id
        this.fetchService.contentPageDetail(id).then(res => {
          this.detail = res.data
        })
      }
    }
  }
</script>

<style scoped>

</style>
